home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 036a / pmfinder.zip / ZIP.H < prev    next >
Text File  |  1991-12-03  |  2KB  |  64 lines

  1. struct ZipLocalFileHeader {
  2.          unsigned VersionNeededToExtract;
  3.          unsigned GeneralPurposeBitFlag;
  4.          unsigned CompressionMethod;
  5.          DOS_FILE_TIME LastModFileTime;
  6.          DOS_FILE_DATE LastModFileDate;
  7.          unsigned long Crc32;
  8.          unsigned long CompressedSize;
  9.          unsigned long UncompressedSize;
  10.          unsigned FileNameLength;
  11.          unsigned ExtraFieldLength;
  12.          };
  13.  
  14. struct CentralDirectoryFileHeader {
  15.          unsigned VersionMadeBy;
  16.          unsigned VersionNeededToExtract;
  17.          unsigned GeneralPurposeBitFlag;
  18.          unsigned CompressionMethod;
  19.          DOS_FILE_TIME LastModFileTime;
  20.          DOS_FILE_DATE LastModFileDate;
  21.          unsigned long Crc32;
  22.          unsigned long CompressedSize;
  23.          unsigned long UncompressedSize;
  24.          unsigned FileNameLength;
  25.          unsigned ExtraFieldLength;
  26.          unsigned FileCommentLength;
  27.          unsigned DiskNumberStart;
  28.          unsigned InternalFileAttributes;
  29.          unsigned long ExternalFileAttributes;
  30.          unsigned long RelativeOffsetLocalHeader;
  31.          };
  32.  
  33. struct EndCentralDirRecord {
  34.          unsigned NumberThisDisk;
  35.          unsigned CentralDirectoryStartDisk;
  36.          unsigned CentralDirEntries_ThisDisk;
  37.          unsigned TotalEntriesCentralDirectory;
  38.          unsigned long SizeCentralDirectory;
  39.          unsigned long OffsetStartCentralDirectory;
  40.          unsigned ZipFileCommentLength;
  41.          };
  42.  
  43. typedef unsigned long SIGNATURE;
  44. typedef struct ZipLocalFileHeader ZIP_LOCAL_FILE_HEADER;
  45. typedef struct CentralDirectoryFileHeader CENTRAL_DIRECTORY_FILE_HEADER;
  46. typedef struct EndCentralDirRecord END_CENTRAL_DIRECTORY_RECORD;
  47.  
  48. #define LOCAL_FILE_HEADER_SIGNATURE 0x04034B50L
  49. #define CENTRAL_FILE_HEADER_SIGNATURE 0x02014B50L
  50. #define END_CENTRAL_DIR_SIGNATURE 0x06054B50L
  51. #define SEARCH_SIZE 2048
  52.  
  53. char *ZipCompression[] = {
  54.          " Stored ", " Shrunk ", "Reduce-1", "Reduce-2", "Reduce-3", "Reduce-4"
  55.          };
  56.  
  57. /*   Prototypes for ZIP Processing Functions          */
  58.  
  59. void ProcessLocalFileHeader (FILE *ZIPFile);
  60. void ProcessCentralFileHeader (FILE *ZIPFile, char *Path);
  61. void ProcessEndCentralDir (FILE *ZIPFile);
  62. int ProcessHeaders (FILE *ZIPFile, char *Path,char *Pattern,HWND hwndListBox);
  63. void GetString (FILE *ZIPFile, int Size, char *Buffer);
  64.